#ifndef PRIORITYQUEUE_H_INCLUDED
#define PRIORITYQUEUE_H_INCLUDED

#include "BinarySearchTree.h"

namespace CEngine {

template<class Element, class Priority = Element>
class PriorityQueue {
    public:

        PriorityQueue(void);

        PriorityQueue(const Element& element, const Priority& priority, const bool smallToBig = true);

        PriorityQueue(const PriorityQueue& pQueue);

        PriorityQueue(const PriorityQueue& pQueue, const bool smallToBig);

        PriorityQueue(const BinarySearchTree<Element, Priority>& tree, const bool smallToBig = true);

        PriorityQueue(Vector<Element>& vector, const Priority& priority, const bool smallToBig = true);

        PriorityQueue&
        operator= (const PriorityQueue& pQueue);

        PriorityQueue&
        operator= (const BinarySearchTree<Element, Priority>& tree);

        PriorityQueue&
        operator= (Vector<Element>& vector);

        ~PriorityQueue(void);

        Element&
        top(void) const;

        void
        push(const Element& element);

        void
        push(const Element& element, const Priority& priority);

        void
        pop(void);

        bool
        isEmpty(void) const;

        U64
        getSize(void) const;

    private:

        BinarySearchTree<Element, Priority> tree;
        bool smallToBig;
};

}

#include "PriorityQueueCore.h"

#endif // PRIORITYQUEUE_H_INCLUDED
